package com.eduction.modules.system.dao;

import com.eduction.common.dbutil.DbHelper;
import com.eduction.modules.system.entity.ArgumentationMaterial;
import com.eduction.modules.system.entity.ExpertItemMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

@Repository
public class ArgumentationMaterialRepository {

	@Autowired
	private DbHelper dbHelper;
	@Autowired
	private ArgumentationMaterialDao argumentationMaterialDao;


	public void save(ArgumentationMaterial argumentationMaterial) {
		argumentationMaterialDao.save(argumentationMaterial);
	}

	public ArgumentationMaterial findBySchoolId(String schoolId) throws SQLException {
		String sql = "SELECT a.p_id as id,a.s_school_id as schoolId,a.file_path as filePath,a.file_name as fileName,a.create_time as createTime  FROM t_argumentation_material a  where a.s_school_id = ?";
		return dbHelper.getBean(sql, ArgumentationMaterial.class, schoolId);
	}
}
